Event Mask Constants
The URL Access Manager defines masks you can use to specify the events for which your notification callback routine should be called. You pass these constants in the
eventRegister
parameter when you call URLOpen
. The
URLEventMask
enumerator defines these mask constants.
enum
{
kURLInitiatedEventMask = 1 << (kURLInitiatedEvent - 1),
kURLResourceFoundEventMask = 1 << (kURLResourceFoundEvent - 1),
kURLDownloadingMask = 1 << (kURLDownloadingEvent - 1),
kURLUploadingMask = 1 << (kURLUploadingEvent - l),
kURLAbortInitiatedMask = 1 << (kURLAbortInitiatedEvent - 1),
kURLCompletedEventMask = 1 << (kURLCompletedEvent - 1),
kURLErrorOccurredEventMask = 1 << (kURLErrorOccurredEvent - 1),
kURLDataAvailableEventMask = 1 << (kURLDataAvailableEvent - 1),
kURLTransactionCompleteEventMask
= 1 << (kURLTransactionCompleteEvent -1),
kURLSystemEventMask = 1 << (kURLSystemEvent - 1 ),
kURLPercentEventMask = 1 << (kURLPercentEventMask -1 ),
kURLPeriodicEventMask = 1 << (kURLPeriodicEvent -1 ),
kURLPropertyChangedEventMask
= 1 << (kURLPropertyChangedEvent -1 ),
kURLAllBufferEventsMask = kURLDataAvailableEventMask
+ kURLTransactionCompleteMask,
kURLAllNonBufferEventsMask = kURLinitiatedEventMask
+ kURLDownloadingMask
+ KURLUploadingMask
+ kURLAbortInitiatedMask
+ kURLCompletedEventMask
+ kURLErrorOccurredEventMask
+ kURLPercentEventMask
+ kURLPeriodicEventMask
+ kURLPropertyChangedEventMask,
kURLAllEventsMask = OxFFFFFFFF
};
typedef UInt32 URLEventMask;
Constant Descriptions
-
kURLInitiatedEventMask
-
Set the bit specified by this mask if you want to be notified when URLOpen
has been called but the location specified by the URL reference has not yet been accessed.
-
kURLResourceFoundEventMask
-
Set the bit specified by this mask if you want to be notified when the location specified by a URL reference has been accessed and is valid.
-
kURLDownloadingMask
-
Set the bit specified by this mask when you want to be notified that a download operation is in progress.
-
kURLUploadingMask
-
Set the bit specified by this mask when you want to be notified that an upload operation is in progress.
-
kURLAbortInitiatedMask
-
Set the bit specified by this mask when you want to be notified that a download or upload operation has been aborted.
-
kURLCompletedEventMask
-
Set the bit specified by this mask when you want to be notified that all operations associated with a call to URLOpen
have been completed. This event indicates either the successful completion of an operation or the completion of cleanup work after aborting the operation.
-
kURLErrorOccurredEventMask
-
Set the bit specified by this mask when you want to be notified that an error has occurred.
-
kURLDataAvailableEventMask
-
Set the bit specified by this mask when you want to be notified that data is available in buffers. If you include a file specification when you call URLOpen
, your notification callback routine is not called.
-
kURLTransactionCompleteEventMask
-
Set the bit specified by this mask when you want to be notified that the operation is complete because there is no more data to retrieve from buffers. If you specify a file specification when you call the URLOpen
, your notification callback routine is not called.
-
kURLPercentEventMask
-
Set the bit specified by this mask when you want to be notified that an increment of one percent of the data has been transferred into buffers. This information is useful if your application displays a progress indictor. This event occurs only when the size of the data being transferred is known.
-
kURLPeriodicEventMask
-
Set the bit specified by this mask when you want to be notified that a time interval of approximately one quarter of a second has passed. You can use this event to report the progress of the download operation when the size of the data is unknown or for other processing that you want to do at a regular interval.
-
kURLPropertyChangedEventMask
-
Set the bit specified by this mask when you want to be notified that a property, such as a filename or user name, has become known or changes. For information about the properties that may cause this event to occur, see
Property Name Constants
.
-
kURLAllBufferEventsMask
-
Set the bit specified by this mask when you want to be notified that a buffer-related event occurred, specifically the
kURLDataAvailableEvent
event and
kURLTransactionCompleteEvent
event. If you include a file specification when you call URLOpen
, your notification callback routine is not called for buffer-related events.
-
kURLAllNonBufferEventsMask
-
Set the bit specified by this mask when you want to be notified that an event unrelated to a buffer occurred; these events include all events except the
kURLDataAvailableEvent
event and
kURLTransactionCompleteEvent
event.
-
kURLAllEventsMask
-
The bit accessed by this mask indicates that an event of any kind occurs. If you include a file specification when you call URLOpen
, your notification callback function will not be called for the
kURLDataAvailableEvent
event and
kURLTransactionCompleteEvent
event.
© 1999 Apple Computer, Inc. – (Last Updated 07 May 99)